home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / text / edit / envwww21.lha / envWWW21 / support / preview_aweb.ged next >
Text File  |  1996-11-13  |  1KB  |  68 lines

  1. /* $VER: 1.0, ©1996 Dietmar Eilert. HTML preview for AWeb 1.2b */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  9.  
  10. if (RC ~= 0) then
  11.     exit
  12.  
  13. OPTIONS FAILAT 6                            /* ignore warnings         */
  14.  
  15. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  16.  
  17. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  18.  
  19. PORTS = show('P')
  20.  
  21. PARSE VAR PORTS DUMMY 'AWEB.' PORTNR .
  22.  
  23. if (PORTNR = "") then
  24.  
  25.     'REQUEST PROBLEM="AWeb ARexx port not found"'
  26.  
  27. else do
  28.  
  29.     'QUERY DOC VAR=DOC'
  30.  
  31.     if (exists(DOC)) then
  32.  
  33.         'SAVE ALL'
  34.  
  35.     else do
  36.  
  37.         DOC = "t:preview.html"
  38.  
  39.         'SAVE ALL EXPORT NAME="' || DOC || '"'
  40.     end
  41.  
  42.     'UNLOCK'
  43.  
  44.     ADDRESS VALUE 'AWEB.' || PORTNR
  45.  
  46.     'GET ACTIVEPORT'
  47.  
  48.     ADDRESS VALUE RESULT
  49.  
  50.     'OPEN RELOAD URL="file://localhost/' || DOC || '"'
  51.  
  52.     exit
  53. end
  54.  
  55. /* ---------------------------- END OF YOUR CODE --------------------- */
  56.  
  57. 'UNLOCK' /* VERY important: unlock GUI */
  58.  
  59. exit
  60.  
  61. SYNTAX:
  62.  
  63. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  64.  
  65. 'UNLOCK'
  66.  
  67. exit
  68.